/**
 * 
 */
package com.ssm.util;

import com.ssm.util.Interface.PageStyle;

/**
 * 默认网页分页样式
 * @author 危文涛<245108903@qq.com>
 * @version 2016年1月31日 下午1:49:11
 *
 */
public class DefaultPageStyle implements PageStyle {

	
	public String CreateHtml(int pageAllNum, int preNum,String address) {
		String html="<div class=\"dataTables_paginate paging_bootstrap\"><ul class=\"pagination\">";
		if(preNum==0)
			html+="<li class=\"prev disabled\"><a href=\"#\"><i class=\"icon-double-angle-left\"/></a></li>";
		else
			html+="<li class=\"prev\"><a href=\""+address+"?pageNum="+(preNum-1)+"\"><i class=\"icon-double-angle-left\"/></a></li>";
		for(int i=0;i<pageAllNum;i++)
		{
			if(preNum==i)
				html+="<li class=\"active\"><a href=\"#\">"+(i+1)+"</a></li>";
			else
				html+="<li><a href=\""+address+"?pageNum="+i+"\">"+(i+1)+"</a></li>";
		}
		if(preNum==pageAllNum-1)
			html+="<li class=\"next disabled\"><a href=\"#\"><i class=\"icon-double-angle-right\"></i></a></li>";
		else
			html+="<li class=\"next\"><a href=\""+address+"?pageNum="+(preNum+1)+"\"><i class=\"icon-double-angle-right\"></i></a></li>";
		html+="</ul></div>";
		
		return html;
	}

	
	
}
